<ion-view view-title="采购退货" show-tabs>
    <ion-content class="create-order">

    <ion-list class="wrap-light2">
        <ion-item class="item-select">
            <span class="input-label text-right">入库仓库</span>
            <select>
              <option ng-repeat="warehouse in warehouses" ng-selected="$index==0">{{warehouse.name}}</option>
            </select>
        </ion-item>
        <ion-item class="item-input margin-bottom-large">
            <span class="input-label text-right">供应商</span>
            <input type="text" name="uname" maxlength="20" required placeholder="选择供应商" ng-model="order.company" ng-click="supplierModal.show()">
        </ion-item>

        <ion-item class="item-divider">
            选择商品
        </ion-item>
        <ion-item class="item-input">
            <section class="grid-response wrap-light">
                <a class="grid-item" ng-click="scanBarcode()">
                    <i class="icon icon-top ion-qr-scanner"></i>
                    <span>扫码添加</span>
                </a>
                <a class="grid-item" href="#/select-products">
                    <i class="icon icon-top ion-ios-list-outline"></i>
                    <span>从采购单退换货</span>
                </a>
                <a class="grid-item" href="#/inventory/brand-list-{{brand.id}}">
                    <i class="icon icon-top ion-android-add"></i>
                    <span>新增</span>
                </a>
            </section>
        </ion-item>

    </ion-list>
        <div class="list accordion-list product-select-list" ng-if="isReturn()">

        <ion-item class="item-divider">
            已选商品
        </ion-item>

            <div ng-repeat="item in products" class="item-thumbnail-left">
                <div class="row">
                    <img ng-src="{{item.thumb}}" class="item-image"/>
                    <div class="col">
                        <div class="title">{{item.type}}</div>
         
                    </div>
                    <div class="col col-blank accordion-handle arrow right-bottom-arrow" ng-class="{on: isItemShown(item)}"  ng-click="toggleItem(item)"></div>
                </div>
                <div class="item-accordion" ng-if="isItemShown(item)">
                    <div class="list list-inset">
                      <label class="item-input">
                        <span class="input-label">颜色</span>
                        <input type="text" placeholder="白色">
                      </label>
                      <label class="item-input">
                        <span class="input-label">内存</span>
                        <input type="text" placeholder="128G">
                      </label>
                      <label class="item-input">
                        <span class="input-label">网络</span>
                        <input type="text" placeholder="电信版">
                      </label>

                      <label class="item-input">
                        <span class="input-label">单价</span>
                        <input type="text" placeholder="2500">
                      </label>
                      
                      <span class="item-input">
                        <span class="input-label">数量</span>
                        <a class="button button-icon icon ion-ios-minus" ng-class="{'button-stable':count==1,'button-balanced':count>1}" ng-click="minusCount()"></a>
                        <input type="text" placeholder="1" ng-model="count">
                        <a class="button button-balanced button-icon icon ion-ios-plus" ng-click="addCount()"></a>
                      </span>
                    </div>

                </div>
            </div>
        </div>




        <a class="button button-block button-balanced" ng-click="updateAccount();" ng-if="isReturn()" href="#/buy">保存</a>

    
  </ion-content>
</ion-view>
